package cn.edu.gdu.quizpractice.service.impl;

import cn.edu.gdu.quizpractice.dao.BankDao;
import cn.edu.gdu.quizpractice.entity.Bank;
import cn.edu.gdu.quizpractice.entity.ChoiceQuestion;
import cn.edu.gdu.quizpractice.service.IBankService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: Aubery
 * @Date: 2025-03-13-22:22
 * @Description:
 */
@Service
public class BankServiceImpl extends ServiceImpl<BankDao,Bank> implements IBankService {

    @Autowired
    private BankDao bankDao;

    @Override
    public boolean updateTotal(Integer id, Integer total) {
        return bankDao.updateTotal(id,total);
    }

    @Override
    public Bank findTotalByName(String name) {
        return bankDao.findTotalByName(name);
    }

    @Override
    public Bank findBankById(Integer id) {
        return bankDao.findBankById(id);
    }

    @Override
    public boolean updateByBankId(Bank bank) {
        return bankDao.updateByBankId(bank);
    }

    @Override
    public List<Bank> findAll() {
        return bankDao.findAll();
    }

    @Override
    public List<ChoiceQuestion> findQuestionsByBankName(String name) {
        return bankDao.findQuestionsByBankName(name);
    }

    @Override
    public boolean audit(Bank bank) {
        return bankDao.audit(bank);
    }


    @Override
    public int getBankCount() {
        return bankDao.getBankCount();
    }

    @Override
    public int getTotalCount() {
        return bankDao.getTotalCount();
    }

    @Override
    public List<Bank> showAuditedBanks() {
        return bankDao.showAuditedBanks();
    }

    @Override
    public List<Bank> showUnAuditedBanks() {
        return bankDao.showUnAuditedBanks();
    }

    @Override
    public Bank findBankInfoByName(String bankName) {
        return bankDao.findBankInfoByName(bankName);
    }

}
